﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleFactoryPattern
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("第一个数");
            string num1Str = Console.ReadLine();
            Console.WriteLine("第二个数");
            string num2Str = Console.ReadLine();
            Console.WriteLine("符号");
            string op = Console.ReadLine();

            int num1, num2, result = 0;
            int.TryParse(num1Str, out num1);
            int.TryParse(num2Str, out num2);

            Operate operate = OperateFactory.CreateOperate(op);

            operate.Num1 = num1;
            operate.Num2 = num2;
            operate.OperateResult();

            var res = operate.Result;

            Console.WriteLine(res);

            Console.ReadKey();


        }
    }
}
